package cc.mcyx.ychat.controller.user

import cc.mcyx.ychat.model.User
import cc.mcyx.ychat.service.UserService
import io.swagger.annotations.Api
import io.swagger.annotations.ApiOperation
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController

@RestController
@RequestMapping("api/user")
@Api("用户", tags = ["用户相关"])
open class UserController {


    @Autowired
    lateinit var userService: UserService

    @GetMapping("info")
    @ApiOperation("获取当前用户信息")
    open fun info(): User {
        return userService.getCurrentUser()
    }
}